<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添福彩票后台管理系统</title>
<link href="/static/css/login.css" rel="stylesheet" type="text/css" />
<link id="skin" rel="stylesheet" href="/static/js/jbox/Skins/Blue/jbox.css" />

<script type="text/javascript" src="/static/js/jquery-1.6.min.js"></script>
<script type="text/javascript" src="/static/js/jbox/jquery.jBox-2.2.min.js"></script>
    
<script type="text/javascript">
	
	$(document).ready(function(){
		//get_check_code();
	})
	
	function get_check_code(){
		$.ajax({
			type: 'POST',
			url: '/get_check_code',
			success:function(data, status){
				$('#checkimage').attr('src', '/static/images/checkcode.gif');
			},
			error:function(req, status, error) {
				$.jBox.tip('error', 'error');
			}
		});
	}
	
	$(document).keypress(function(e){
		if(e.keyCode == 13){
			dosubmit();
		}
	});

	function dosubmit(){
		username = $("#login_form input[name='username']").val();
		password = $("#login_form input[name='password']").val();
		
		if(username == '' || password == ''){
			$.jBox.tip("用户名密码不能为空","error");
		}
		
		$.ajax({
			type: 'POST',
			url: '/login',
			data: $("#login_form").serialize(),
			//dataType: 'json',
			//get_check_code_image
			success:function(data, status){
				window.location.href="home"
			},
			error:function(req, status, error) {
				$.jBox.tip(req.responseText, 'error');
			}
		});
	}
	
</script>
</head>

<body >
<div id="wrap">
	<div id="header"> </div>
    <div id="content-wrap">
    	<div class="space"></div>

   	  <form id="login_form" action="login" method="post">
   	  	<div class="content">
        	<div class="field"><label>账　户：</label><input class="username" name="username" type="text" maxlength="20" /></div>
			<div class="field"><label>密　码：</label><input class="password" name="password" type="password"  maxlength="20"/><br/></div>
			<!-- <div class="field"><label>验证码：</label><input name="checkcode" type="text" size="12" />
				<img id="checkimage" src="" alt="CheckCode"/> 
			<br/></div> -->
        	<div class="btn"><input id="loginbtn_id" name="loginbtn" type="button" class="login-btn" value="" onclick="dosubmit();" /></div>
      	</div>
      </form>

    </div>
    <div id="footer"> </div>
</div>
</body>
</html>
